package com.gljx.web.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gljx.web.Entity.StudentInitiativeCar;
import com.gljx.web.dao.StudentInitiativeCarMapper;
import com.gljx.web.service.StudentInitiativeCarService;

@Service
@Transactional
public class StudentInitiativeCarServiceImpl implements StudentInitiativeCarService{

	@Autowired
	private StudentInitiativeCarMapper studentInitiativeCarMapper;
	
	@Override
    public List<StudentInitiativeCar> queryShareCarSubByStudentId(String studentId) {
        // TODO Auto-generated method stub
		return studentInitiativeCarMapper.selectShareCarSubByStudentId(studentId);
	}

	@Override
	public List<StudentInitiativeCar> selectPracticeCarTime(String time, String subject, String cftime,
			String carType) {
		// TODO Auto-generated method stub
		Map<String, Object> map = new HashMap<>();
		map.put("time", time);
		map.put("subject", subject);
		map.put("cftime", cftime);
		map.put("carType", carType);
		return studentInitiativeCarMapper.selectPracticeCarTime(map);
	}

	@Override
	public String queryOrderSum(String exercisecarplanId,String coachId) {
		// TODO Auto-generated method stub
		Map<String, String> map = new HashMap<>();
		map.put("exercisecarplanId", exercisecarplanId);
		map.put("coachId", coachId);
		return studentInitiativeCarMapper.selectOrderSum(map);
	}

	@Override
	public List<StudentInitiativeCar> queryCoach(String lcsjId) {
		// TODO Auto-generated method stub
		return studentInitiativeCarMapper.selectCoach(lcsjId);
	}

    @Override
    public StudentInitiativeCar selectPracticeCarTimeByFid(String lcsjfid) {
        return studentInitiativeCarMapper.selectPracticeCarTimeByFid(lcsjfid);
    }

    @Override
    public int selectPracticeCarTimeByInfo(String lcsjfid, String fid) {
        return studentInitiativeCarMapper.selectPracticeCarTimeByInfo(lcsjfid, fid);
    }

}
